import '../Pages/Medicinebox.dart';
import '../Pages/AddRemind.dart';
import '../Settings/Login.dart';
import 'package:flutter/material.dart';
import '../Tabs/Tabs.dart';
import '../Settings/Setting.dart';
import '../Pages/box.dart';
import '../Pages/MedicineChest.dart';
import '../Utils/localNotification.dart';
import '../Utils/alarmManager.dart';
import '../Utils/DataManager.dart';
import 'package:android_alarm_manager/android_alarm_manager.dart';
import '../Pages/WarningPage.dart';
import '../Settings/login_page.dart';

main() async {
  WidgetsFlutterBinding.ensureInitialized();
  initNotification();
  await AndroidAlarmManager.initialize();
  await dao.openSqlite();
  await dataManager.load();
  await printPeriodic();
  runApp(MyApp());
//  await AndroidAlarmManager.periodic(const Duration(seconds: 5), 1, printHello);


  await AndroidAlarmManager.periodic(const Duration(seconds: 5), 2, rington);
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    return MaterialApp(
      debugShowCheckedModeBanner: true,
      home: Login(),//Login(),
      routes: {
        'MySetting':(context)=>MySetting(),
        'Tabs':(context)=>Tabs(),
        'Login':(context)=>Login(),
        'addRemind':(context)=>addRemind(),
        'MedicineChest':(context)=>MedicineChest(),
        'Box':(context)=>Box(),
        'WarningPage':(context)=>WarningPage(),
        'LoginPage':(context)=>LoginPage(),
      },
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
    );
  }
}



